//
//  HSForumListVM.m
//  HolyShit
//
//  Created by Robin on 2017/4/4.
//  Copyright © 2017年 HolyShit. All rights reserved.
//

#import "HSForumListVM.h"

@implementation HSForumListVM

- (RACCommand *)dataCommand{
    if(!_dataCommand){
        @weakify(self);
        _dataCommand = [RACCommand commandWithSignalBlock:^RACSignal *(id input) {
            return [[MYHttpHelper shareHelper] rac_getWithUrl:[AppHost stringByAppendingString:TagPath]  params:nil success:^(NSDictionary *dict) {
                if (![dict containsObjectForKey:@"data"]) {
                    return ;
                }
                @strongify(self);
                self.forums = [NSArray modelArrayWithClass:[HSForumListModel class] json:dict[@"data"]];
            } failed:^(NSError *error) {
                
            }].racSignal;
        }];
    }
    return _dataCommand;
}

@end
